<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>支付成功Payment_Success</title>
    <link rel="stylesheet" href="css/head_top_footer.css" />
    <link rel="stylesheet" href="css/Payment_Success.css" />
    <script src="js/jquery.min.js"></script>
    <script src="js/hk库.js"></script>
	<script>
		$(function(){
			// 公共部分
			$('.header').load('head.html');
			$('.footer').load('footer.html');
		});
		
		window.onload = function(){
			$orderNo = GetQueryString('orderNo');
			if ($orderNo == undefined){
				alert('参数不完整!!!');
				window.location.href = 'index.html';
			}
			
			$.ajax(
			{
				url: $server+'order/detail.do',
				type: "POST",
				data:{orderNo : $orderNo},
				datatype: 'json',		
				crossDomain:true, //设置跨域为true
				xhrFields:{
					withCredentials: true // 携带跨域cookie
				},
				success: function(result){
					console.log(result);
					if (result.code == 200 && result.data != undefined){
						$('.totalPrice')[0].innerHTML = result.data.payment;
						var shipping = result.data.shippingVo;
						$('.receive')[0].innerHTML = shipping.receiverCity+' '+shipping.receiverDistrict+' '+shipping.receiverAddress+' '+shipping.receiverName+' 收 '+shipping.receiverPhone
					}else{
						alert('订单不存在!!!');
						window.location.href = 'index.html';
					}
				},
			});
		}
		
		// 从地址栏获取参数
		function GetQueryString(name)
		{
		     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
		     var r = decodeURI(window.location.search.substr(1)).match(reg);
		     if(r!=null)return  unescape(r[2]); return null;
		}
	</script>
</head>
<body>
    <!--头部-->
    <div class="header"></div>

    <!--框-->
    <div class="pay_success_bor">
        <div class="pay_success">
            <div class="pay_success1">
                <img src="img/pay_all/success.png" alt="">
                <div>您已成功付款<span class="totalPrice"></span>元</div>
            </div>
            <div class="pay_success2">
                <!-- <p>货物寄送至:广东省 广州市 海珠区 江海街道 红卫新村西华17巷3号 党伟隆 收 18177177115 </p> -->
				<p>货物寄送至:<span class="receive"></span></p>
            </div>

            <div class="pay_success3">
                <a href="order.html">已买到宝贝列表</a>
                <!-- <a href="我的订单页.html">订单详情</a> -->
            </div>

          <!--  <div class="pay_success4">
                <a href="#">点击领取小礼物：</a>
            </div> -->

            <div class="pay_success5">
                <img src="img/pay_all/remind.png" alt="">
                <div class="pay_success5_1">
                    <span>安全提醒:</span>
                    <span>下单后,<span>用QQ给您发送链接办理退款的都是骗子</span>！</span>
                </div>
                <div class="pay_success5_2">
                    <span>谨防假冒客服电话诈骗！</span>
                    <a href="index.html">安心购物，安全无忧》</a>
                </div>
            </div>

        </div>
    </div>

	<!--底部-->
	<div class="footer"></div>
</body>
</html>